package com.webserver.servlet;

import com.webserver.http.HttpRequest;
import com.webserver.http.HttpResponse;
import com.webserver.vo.User;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class DeleteServlet {
    public void service(HttpRequest request, HttpResponse response){
        System.out.println("开始处理删除业务...");

        String username = request.getParameter("username");
        File file = new File(username+".user");
        if (file.exists()){
            file.delete();
            response.sendRedirect("./showAllUser");
        }
        System.out.println("删除业务处理完成.");
    }
}